/**
 * Created by 000188 on 2016/7/5.
 */
import React from 'react';
import ReactDom from 'react-dom';
let Brand = require('brand');
let Logo = require('logo');
let Btn = require('btn');
let Share = require('share');

let endMsg = React.createClass({
    render(){
        return <div>
            <Logo />
            <Brand imgUrl={this.props.imgUrl} />
            <Btn width="100%" ref="share" click={()=>{Share.render('赶快喊您的小伙伴 来抢东航红包')}} text="把好消息告诉大家" />
            <Btn href="http://mobile.ceair.com/?from=timeline&isappinstalled=1" text="下载东方航空APP 参与更多活动" width="100%" />
        </div>
    },
    isWX(){
        var ua = navigator.userAgent.toLowerCase();
        if(ua.match(/MicroMessenger/i)=="micromessenger") {
            return true;
        } else {
            return false;                                                                                                                                                                        ``
        }
    },
    componentDidMount(){
        if(!this.isWX()){
            ReactDom.findDOMNode(this.refs.share).style.display = 'none';
        }
    }
})

module.exports = endMsg;